﻿using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Data;
namespace WPFExcelReport
{
    public partial class TJLFSTKCHG
    {
        public TJLFSTKCHG()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VICC_STOCKCHG();
            this.DataContext = MV;
            InitializeComponent();

        }
        public override void LOADBYAUF()
        {
            TBMain.Clear();
            if (ORDERNUM.Length < 152)
                return;
            dwData = TBMain.NewRow();
            dwData["MANDANT"] = app.Mandant;
            dwData["LO"] = ORDERNUM.Substring(0, 2);
            dwData["LB"] = ORDERNUM.Substring(2, 2);
            if (IsRange)
            {
                dwData["BSDES"] = "AND MDATE>=" + DTSTART + " AND MDATE<=" + DTEND;
            }
            else
            {
                dwData["BSDES"] = "AND MDATE=" + ORDERNUM.Substring(4, 8);
            }
            dwData["WAKZ"] = ORDERNUM.Substring(12, 1);
            dwData["ART"] = ORDERNUM.Substring(13, 20);
            dwData["VAR"] = ORDERNUM.Substring(33, 2);
            dwData["FARBE"] = ORDERNUM.Substring(35, 10);
            dwData["FINISH"] = ORDERNUM.Substring(45, 10);
            dwData["DESS"] = ORDERNUM.Substring(55, 10);
            dwData["COLORIT"] = ORDERNUM.Substring(65, 10);
            dwData["FSIZE"] = ORDERNUM.Substring(75, 7);
            dwData["FBPART"] = ORDERNUM.Substring(82, 10);
            dwData["SPPART"] = ORDERNUM.Substring(92, 10);
            dwData["ZWPART"] = ORDERNUM.Substring(102, 10);
            dwData["BEM1"] = ORDERNUM.Substring(112, 40);
            SResult=TMV.QueryICC_STOCKCHG(dwData, 3);
            MergeData(SResult, false);
            base.LOADBYAUF();
        }
    }
}
